#include <iostream>
#include <string>
#include <vector>
using namespace std;

int no_or_yes_question(string question){
	char answer;
	do{
		cout << question << " (y/n): ";
		cin >> answer;
	} while (answer != 'n' && answer != 'y');
	if(answer == 'n')return 0;
	else return 1;
}
vector<string> show_command(string question, string type){
	int result = no_or_yes_question(question);
	vector<string> commands;
	if(result){
		int answer=1;
		string command;
		string q = "Do you want to add another ";
		q.append(type);
		while(answer != 0){
			cout << "Enter " << type << " #" << commands.size()+1 << ": ";
			cin.ignore();
			getline(cin,command);
			string ques="Is this command correct: ";
			ques.append(command);
			if(no_or_yes_question(ques)){
				commands.push_back(command);
			}
			answer = no_or_yes_question(q);
		}
	}
	return commands;
}

int main (){
	cout << "Welcome to Hindseight!\n";
	cout << "Enter Location for storage: ";
	string storage_loc;
	cin >> storage_loc;
	vector<string> pre_commands = show_command("Do you want to add a pre copy command?", "pre copy command");
	vector<string> post_commands = show_command("Do you want to add a post copy command?", "post copy command");

	//Enter Directory to copy over
	//Enter where to save it
		//Add Exclude Directory

	 for(int i=0; i<pre_commands.size(); i++)
		cout << pre_commands[i] << endl;

	return 0;
}
